<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on指令</title>
    <script src="vue.js"></script>
    <style>
        .parent{
            width: 200px;
            height: 160px;
            background-color: yellow;
        }
        .child{
            width: 100px;
            height: 80px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="parent" v-on:click.self="parentMethod">
            <div class="child" v-on:click="childMethod"></div>
        </div>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        methods: {
            parentMethod(){
                console.log("****parent****");
            },
            childMethod(){
                console.log("*****child*****");
            }
        },
      
    });
</script>